import request from "@/utils/request";

export default {
    //获取最新公告信息
    getListByType(page, limit, type) {
        return request({
            method: "GET",
            url: "/waterCutOffNoticeInfo/list",
            params: {
                page: page,
                limit: limit,
                type: type,
            }
        })
    },
    getDetailById(id) {
        return request({
            method: "POST",
            url: "/waterCutOffNoticeInfo/detail",
            params: {
                id: id,
            }
        })
    },

    getWaterInfoList(page, limit, tag, region) {
        return request({
            method: "GET",
            url: "/waterMeterRepairInfo/list",
            params: {
                page: page, //当前页
                limit: limit, //每页数据多少条
                tag: tag,  // 标题
                region: region
            }
        })
    },
    UploadImgs(files) {
        const data = new FormData();
        data.append("file", files);
        return request({
            headers: {
                'Content-Type': 'multipart/form-data'
            },
            method: "POST",
            url: "/fastDFS/uploads",
            data: data
        })
    },
    submitInfoList(name, phone, address, remarks, classify, scenePhotos, otherPhotos, reg) {
        return request({
            method: "POST",
            url: "/waterMeterRepairInfo/addItem",
            params: {
                name: name,
                phone: phone,
                address: address,
                remarks: remarks,
                repairItems: classify,
                // idCardOriginal: FrontIDCard,
                // idCardCounter: ReverseIDCard,
                scenePhotos: scenePhotos,
                otherPhotos: otherPhotos,
                region: reg,
                // createTime: myDate,
            }
        })
    }
}


